package com.io.bean.circulardependency;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
// JDK 11被移除需要添加额外的jakarta.annotation-api
import javax.annotation.PostConstruct;

/**
 * @author guodd
 * @version 1.0
 * @since JDK1.8
 */
@Service
public class Y {
	@Autowired
	X x;

	public Y() {
		System.out.println("constructor...Y");
	}

	// 生命周期初始化回调方法
	@PostConstruct
	public void init() {
		System.out.println("init....Y");
	}

	public X getX() {
		return x;
	}
}
